<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title id="title"></title>
    <%include("/app/resapi/mobilestyle.html"){}%>
</head>
<body style="overflow-y: auto;">
<ul class="m-grids-2">
    <li class="grids-item">
        <div class="grids-txt" style="text-align: left">日志类型:<span id="diaryType"></span></div>
    </li>
</ul>
<div style="background: #FFFFFF;padding: 10px;font-size: 14px;min-height: 200px;">
    <p id="content" align="left"></p>
</div>
<div class="mail-attachments" id="attach" style="margin-bottom: 50px;margin-top: 5px;margin-left: 5px;" align="left">
    <h4>
        <i class="fa fa-paperclip"></i> 附件： <span id="attachCount"></span>
    </h4>
    <div id="show_attach"></div>
</div>
<ul class="m-grids-2">
    <li class="grids-item">
        <div class="grids-txt" style="text-align: left">日志日期:<span id="diaryDay"></span></div>
    </li>
    <li class="grids-item">
        <div class="grids-txt" style="text-align: right">${i18n('system.createUser')}:<span id="createUser"></span></div>
    </li>
</ul>
<%include("/app/resapi/mobilejs.html"){}%>
<script type="text/javascript">
    var diaryId = "${parameter.diaryId}";
</script>
<script type="text/javascript" src="/module/fileupload/ajaxfileupload.js"></script>
<script type="text/javascript" src="/module/fileupload/mobilefileupload.js"></script>
<script type="text/javascript">
    $(function () {
        bindData();
    });

    function bindData() {
        $.ajax({
            url: "/ret/oaget/getMobileDiaryInfo",
            type: "post",
            dataType: "json",
            data: {
                diaryId: diaryId
            },
            success: function (data) {
                if (data.status == "500") {
                    console.log(data.msg);
                } else if (data.status == "100") {
                    layer.msg(data.msg);
                } else {
                    for (var name in data.list) {
                        if (name == "attach") {
                            $("#attach").attr("data_value", data.list.attach);
                            createAttach("attach", data.list.attachPriv);
                        } else if (name == "diaryType") {
                            if (data.list.diaryType == "1") {
                                $("#" + name).html("部门工作汇报");
                            } else if (data.list.diaryType == "2") {
                                $("#" + name).html("个人工作日志");
                            }
                        } else if (name == "createUser") {
                            $("#" + name).html(getUserNameByStr(data.list.createUser));
                        } else {
                            $("#" + name).html(data.list[name]);
                        }
                    }
                }
            }
        })
    }
</script>
</body>
</html>
